<template>
	<view class="content">
		<!-- 电量显示栏-->
		<!-- <view class="kong"></view> -->
		<!-- 背景图 -->
		<image class="bg" src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/bg.png" mode="scaleToFill"></image>
		<!-- 顶部 -->
		<view class="top_bar">
			<view class="location">{{ location }}</view>
			<view class="img"><image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/top/laba.png" mode="scaleToFill"></image></view>
			<view class="tongzhi">
				<swiper class="swiper" autoplay interval="3000" duration="1000" circular vertical>
					<swiper-item class="item" v-for="(item, index) in news" :key="index">
						<view class="swiper-item">{{ item.notice }}</view>
					</swiper-item>
				</swiper>
			</view>
			<view class="saoma" @click="scanCode"><image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/top/sao.png" mode="scaleToFill"></image></view>
		</view>
		<!-- 进入快捷支付提示 -->
		<openAlert class="openAlert" ref="openAlert1" BgColor="rgba(0, 0, 0, 0.7)" :AlertClass="AlertClass" :AlertPosition="AlertPosition">
			<view class="modal_wrap">
				<view class="modal_title">温馨提示</view>

				<view class="modal_content"><view class="con_item">是否前往</view></view>

				<view class="btn_wrap">
					<view class="cancel_btn" @click.stop="cancel">取消</view>
					<view class="modal_btns" @click="code_url(scanCodes)">前往</view>
				</view>
			</view>
		</openAlert>
		<openAlert class="openAlert" ref="openAlert2" BgColor="rgba(0, 0, 0, 0.7)" :AlertClass="AlertClass" :AlertPosition="AlertPosition">
			<view class="modal_wrap">
				<view class="modal_title">温馨提示</view>

				<view class="modal_content">
					<view class="con_item" v-if="cards == null">检测到您尚未添加收款卡，是否前往添加</view>
					<view class="con_item" v-else-if="isOpen == false">检测到您尚未开通快捷支付，是否前往开通</view>
					<view class="con_item" v-else>检测到您已开通快捷支付，是否前往快捷支付</view>
				</view>

				<view class="btn_wrap">
					<view class="cancel_btn" @click.stop="cancel1">取消</view>
					<view class="modal_btns" @click="open_notCard">前往</view>
				</view>
			</view>
		</openAlert>
		<!-- 刷卡收款 -->
		<view class="init_money">
			<view class="bg_tu"><image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/top/bg.png" mode="scaleToFill"></image></view>
			<view class="content">
				<view class="title">刷卡收款</view>
				<view class="wrap">
					<view class="wrap_top">
						<view class="fuhao">
							<image class="qian_img" src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/top/money.png" mode="scaleToFill"></image>
						</view>
						<view class="input">
							<input
								type="number"
								name="money"
								placeholder-style="font-size:30rpx;color:#777777;"
								maxlength="5"
								placeholder="请输入收款金额"
								style="text-align: right;"
								data-key="pay_s"
								@input="inputChange"
								:value="pay_s"
							/>
						</view>
						<view class="yuan">元</view>
					</view>
					<view class="shoukuan_btn" @click="not_pay">立即收款</view>
				</view>
			</view>
		</view>

		<!-- 选项卡 -->
		<view class="xuanxiangka">
			<view class="card">
				<view class="card_item" v-for="(item, index) in card" :key="index" @click="navTo(item)">
					<view class="img"><image :src="item.img" mode="scaleToFill"></image></view>
					<view class="title">{{ item.title }}</view>
				</view>
			</view>
		</view>

		<!-- 轮播图 -->
		<view class="banner">
			<swiper indicator-dots autoplay indicator-color="#b9babb" indicator-active-color="#ffffff" interval="3000" duration="1000" circular>
				<swiper-item v-for="(item, index) in swiper" :key="index">
					<image :src="Config_ysy.cosurl + item.image" mode="scaleToFill" @click="link_url(item.url)"></image>
				</swiper-item>
			</swiper>
		</view>

		<!-- 明星产品 -->
		<view class="mingxing_product">
			<view class="product_title">
				<view class="title_left">
					<view class="img"><image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/ditu.png" mode="scaleToFill"></image></view>
					<view class="name">明星产品</view>
				</view>
				<view class="title_right" @click="mallList">
					<text>更多产品</text>
					<image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/right.png" mode="aspectFit"></image>
				</view>
			</view>
			<view class="product_content">
				<view class="content_wrap">
					<view class="content_item" v-for="(item, index) in product" :key="index" @click="go_goodsDetail(item)">
						<view class="img">
							<image :src="Config_ysy.cosurl + item.image" mode="scaleToFill"></image>
							<!-- <view class="title"></view> -->
						</view>
						<view class="name">
							<view class="name_detail">{{ item.name }}</view>
							<!-- <view class="biaoqian">{{ item.biaoqian }}</view> -->
						</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 特色服务 -->
		<view class="searve">
			<view class="product_title">
				<view class="title_left">
					<view class="img"><image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/ditu.png" mode="scaleToFill"></image></view>
					<view class="name">特色服务</view>
				</view>
				<view class="title_right" @click="more_serve">
					<text>更多服务</text>
					<image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/right.png" mode="aspectFit"></image>
				</view>
			</view>
			<view class="searve_xiang">
				<view class="searve_item" v-for="(item, index) in searve" :key="index" @click="navToSeaver(item)">
					<view class="img"><image :src="item.img" mode="scaleToFill"></image></view>
					<view class="title">{{ item.title }}</view>
				</view>
			</view>
		</view>

		<!-- 行业资讯 -->
		<view class="industry_information" @click="go_zixunList">
			<view class="title">
				<view class="img"><image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/ditu.png" mode="scaleToFill"></image></view>
				<view class="name">行业资讯</view>
			</view>
			<view class="title_right">
				<text>更多资讯</text>
				<image src="https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/right.png" mode="aspectFit"></image>
			</view>
		</view>
		<view class="information_content">
			<view class="content_item_zixun" v-for="(item, index) in information" :key="index" @click="toZixunDetail(item)">
				<view class="content_left_zixun">
					<view class="content_title">{{ item.title }}</view>
					<view class="content_box">{{ item.subtitle }}</view>
					<view class="content_bottom">
						<view class="bottom_right">{{ item.addtime }}</view>
					</view>
				</view>
				<view class="content_right_zixun"><image :src="Config_ysy.cosurl + item.a_image" mode="scaleToFill"></image></view>
			</view>
		</view>
		<!-- 底部导航栏 -->
		<!-- <wyg-bottom-tab-withcenter :tabIndex="tab_index_click" @select_click="select_click"></wyg-bottom-tab-withcenter> -->
		<view class="bottom-tab">
			<view class="bottom-tab-item-sider" @click="changeTab(item.id)" v-for="(item, index) in tabListParent" :key="index">
				<image v-if="index == 0" class="first-img" :src="item.imgOn"></image>
				<image v-if="index != 0" class="first-img" :src="item.imgOff"></image>
				<text :class="index == 0 ? 'text-position text-on' : 'text-position'">{{ item.name }}</text>
			</view>
		</view>
		<!-- 检查会员 -->
		<check ref="check"></check>
	</view>
</template>

<script>
// import wygBottomTabWithcenter from '@/components/wyg-bottom-tab/wyg-bottom-tab-withcenter.vue';
import { mapState } from 'vuex';
import openAlert from '@/components/open-alert/open-alert';
import check from '@/components/check/check/check';
// 兼容
var browser = {
	versions: (function() {
		var u = navigator.userAgent,
			app = navigator.appVersion;
		return {
			trident: u.indexOf('Trident') > -1,
			/*IE内核*/
			presto: u.indexOf('Presto') > -1,
			/*opera内核*/
			webKit: u.indexOf('AppleWebKit') > -1,
			/*苹果、谷歌内核*/
			gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,
			/*火狐内核*/
			mobile: !!u.match(/AppleWebKit.*Mobile.*/),
			/*是否为移动终端*/
			ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
			/*ios终端*/
			android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
			/*android终端或者uc浏览器*/
			iPhone: u.indexOf('iPhone') > -1,
			/*是否为iPhone或者QQHD浏览器*/
			iPad: u.indexOf('iPad') > -1,
			/*是否iPad*/
			webApp: u.indexOf('Safari') == -1,
			/*是否web应该程序，没有头部与底部*/
			souyue: u.indexOf('souyue') > -1,
			superapp: u.indexOf('superapp') > -1,
			weixin: u.toLowerCase().indexOf('micromessenger') > -1,
			Safari: u.indexOf('Safari') > -1
		};
	})(),
	language: (navigator.browserLanguage || navigator.language).toLowerCase()
};
export default {
	components: { check, mapState, openAlert },
	data() {
		return {
			tabListParent: [
				{
					id: 1,
					name: '首页',
					imgOff: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/home.png',
					imgOn: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/home_select.png',
					url: '/pages/center/ai'
				},
				
				{
					id: 2,
					name: '任务',
					imgOff: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/rewu_select.png',
					imgOn: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/rewu.png',
					url: '/pages/center/center'
				},
				{
					id: 3,
					name: '公域',
					imgOff: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/business.png',
					imgOn: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/business_select.png',
					url: '/pages/saasShop/equity'
				},
				{
					id: 4,
					name: '课程',
					imgOff: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/kecheng_select.png',
					imgOn: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/kecheng.png',
					url: '/pages/center/cart'
				},
				// { id: 5, name: '消息', imgOff: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/news.png', imgOn: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/news_select.png', url: '/pages/center/user_chat/news_list' },
				{
					id: 5,
					name: '我的',
					imgOff: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/mine.png',
					imgOn: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/newTab/mine_select.png',
					url: '/pages/center/user'
				}
			],
			location: '定位中..',
			tab_index_click: '1',
			AlertClass: 0,
			AlertPosition: '',
			pay_s: null,
			//是否开通无卡支付
			isOpen: false,
			news: [
				// {
				// 	notice: '恭喜***开通VIP'
				// },
				// {
				// 	notice: '恭喜***开通VIP'
				// },
				// {
				// 	notice: '恭喜***开通VIP'
				// },
				// {
				// 	notice: '恭喜***开通VIP'
				// },
				// {
				// 	notice: '恭喜***开通VIP'
				// }
			],
			card: [
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/zhangdan.png',
					title: '快捷支付',
					url: 'http://newpay-api.txguu.cn/share/dsShare?invite=e09669938'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/ceka.png',
					title: '一键测卡'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/banka.png',
					title: '在线办卡'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/daikuan.png',
					title: '极速贷款'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/wangzhuan.png',
					title: '网赚',
					url: '../makeMoneyOnline/makeMoneyOnline'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/NFC.png',
					title: 'NFC'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/erweima.png',
					title: '二维码收款'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/jingang/searve.png',
					title: '更多服务'
				}
			],
			swiper: [
				// {
				// 	img: '../../static/banner.png'
				// },
				// {
				// 	img: '../../static/banner.png'
				// },
				// {
				// 	img: '../../static/banner.png'
				// }
			],
			product: [
				// {
				// 	img: '../../static/pos.png',
				// 	title: 'pos机品牌',
				// 	name: 'pos机',
				// 	biaoqian: '热销'
				// }
			],
			curTab: 1,
			searve: [
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/searve/online.png',
					title: '在线教程',
					url: '/pages/useDirections/useDirections'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/searve/help.png',
					title: '帮助中心',
					url: '/pages/helpCenter/helpCenter'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/searve/kefu.png',
					title: '在线客服',
					url: '/pages/kefu/kefu'
				},
				{
					img: 'https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/searve/init.png',
					title: '加入我们',
					url: '/pages/joinMine/joinMine'
				}
			],
			information: [
				// {
				// 	title: 'A股本周持续下跌，查看专家分析',
				// 	content: 'A股画风突变，大批股民损失惨重，A股本周持续下跌，查看专家分析，A股画风突变，大批股民损失惨重，A股本周持续下跌，查看专家分析',
				// 	address: '千库股票研究所',
				// 	time: '2020-4-20 14:42',
				// 	img: '../../static/zixun.png'
				// },
				// {
				// 	title: 'A股本周持续下跌，查看专家分析',
				// 	content: 'A股画风突变，大批股民损失惨重，A股本周持续下跌，查看专家分析，A股画风突变，大批股民损失惨重，A股本周持续下跌，查看专家分析',
				// 	address: '千库股票研究所',
				// 	time: '2020-4-20 14:42',
				// 	img: '../../static/zixun.png'
				// },
				// {
				// 	title: 'A股本周持续下跌，查看专家分析',
				// 	content: 'A股画风突变，大批股民损失惨重，A股本周持续下跌，查看专家分析，A股画风突变，大批股民损失惨重，A股本周持续下跌，查看专家分析',
				// 	address: '千库股票研究所',
				// 	time: '2020-4-20 14:42',
				// 	img: '../../static/zixun.png'
				// }
			],
			scanCodes: null,
			code: null,
			cards: null,
			token: '8eacbb16-0781-4702-bbfa-7d5e3a0b0d2c',
			shop_id: '',
			mobile: null
		};
	},
	computed: {
		...mapState(['hasLogin', 'userInfo'])
	},
	onLoad(option) {
		this.shop_id = option.shop_id;
		this.token = option.token;
		this.Unfold_data.upload_data({ token: this.token }, 'POST', '/api/usercenter/user', res => {
			if (res.statusCode == 200 && res.data.code == 1) {
				uni.setStorageSync('userStatus', res.data.data.user_level);
				uni.setStorageSync('userInfo', res.data.data);
				uni.setStorageSync('parentMobile', res.data.data.puser.mobile);
			}
		});

		//地址解析
		this.address_x();
		// 自动更新
		// this.plusReady();
		// this.isandroid();
		// pos机列表
		var url = '/api/home/index/posList';
		let params = {
			token: this.token
		};

		this.Unfold_data.upload_data(params, 'GET', url, res => {
			this.Unfold_data.refreshToken(res);
			if (res.statusCode == 200 && res.data.code == 1) {
				this.product = res.data.data;
			} else {
				this.Unfold_data.showWindow(res.data.msg);
			}
		});
		//轮播、资讯
		var url1 = '/api/home/index/adArchivesList';
		let params1 = {
			token: this.token
		};
		this.Unfold_data.upload_data(params1, 'GET', url1, res => {
			this.Unfold_data.refreshToken(res);
			if (res.statusCode == 200 && res.data.code == 1) {
				this.swiper = res.data.data.ad;
				this.information = res.data.data.archives;
			} else {
				this.Unfold_data.showWindow(res.data.msg);
			}
		});
	},
	onReady() {},
	onShow() {
		//获取lunbotu
		this.ad();

		//判断是否实名
		var userInfo = uni.getStorageSync('userInfo');
		console.log('user', userInfo);
		//判断是否登录
		// if (!userInfo) {
		// 	uni.navigateTo({
		// 		url: '/pages/login/login',

		// 	});
		// 	return;
		// }

		let userStatus = uni.getStorageSync('userStatus');
		console.log(userStatus);
	},
	methods: {
		//解析地址
		address_x() {
			var address = uni.getStorageSync('address');

			// console.log(address.longitude)
			// "latitude": 24.995676,
			// "longitude": 102.740863,
			let params = {
				longitude: address.longitude,
				latitude: address.latitude,
				token: this.token
			};
			var url = '/api/quickpay/order/location';
			this.Unfold_data.upload_data(params, 'POST', url, res => {
				console.log('res', res);
				if (res.statusCode == 200 && res.data.code == 1) {
					//删除逗号
					if (res.data.data.cityCode != 0) {
						this.location = res.data.data.addressComponent.city;
						this.code1 = res.data.data.cityCode;
					} else {
						this.Unfold_data.showWindow('请开启定位功能');
						this.location = '定位失败！';
					}
					console.log(this.location);
				} else {
					//显示错误信息
					// this.Unfold_data.showWindow(res.data.msg);
				}
			});
		},
		//前往开通快捷支付
		open_notCard() {
			//关闭提示框
			this.cancel1();
			var url = '';
			var title = '';

			if (this.isOpen == false && this.cards != null) {
				uni.setStorageSync('prices', this.pay_s);
				url = '/pages/openNotCard/openNotCard?token=' + this.token;
				title = '正在前往开通快捷支付';
			} else if (this.cards == null) {
				uni.setStorageSync('prices', this.pay_s);
				url = '/pages/cardManagement/cardManagement?source=not_card' + '&token=' + this.token;
				title = '正在前往添加收款卡';
			} else if (this.isOpen == true) {
				url = '/pages/Payment_without_card/Payment_without_card?price=' + this.pay_s + '&token=' + this.token;
				title = '正在前往快捷支付';
			}
			uni.showLoading({
				title: title,
				mask: true
			});
			setTimeout(() => {
				// console.log(url);
				uni.hideLoading();
				uni.navigateTo({
					url: url
				});
			}, 1000);
			// uni.navigateTo({
			// 	url:'/pages/Payment_without_card/Payment_without_card'
			// })
		},
		//关闭提示框
		cancel() {
			this.$nextTick(function() {
				this.$refs.openAlert1.Close();
			});
		},
		//关闭提示框
		cancel1() {
			this.$nextTick(function() {
				this.$refs.openAlert2.Close();
			});
		},
		//打开

		//app scanCode扫码
		scanCode() {
			this.Unfold_data.scanCode(res => {
				this.scanCodes = res.result;
				//打开弹窗提示
				this.$nextTick(function() {
					this.AlertClass = 0;
					this.AlertPosition = 'center';
					this.$nextTick(function() {
						// console.log(this.$refs)
						this.$refs.openAlert1.Show();
					});
				});
			});
		},
		//跳转二维码扫描结果
		code_url(url) {
			//关闭弹框提示
			this.cancel();
			//跳转
			this.Unfold_data.externalLinks(url);
		},
		//首页公告
		ad() {
			var url = '/api/home/index/adUserApply';
			let params = {
				token: this.token
			};
			this.news = [];
			this.Unfold_data.upload_data(params, 'GET', url, res => {
				this.Unfold_data.refreshToken(res);
				if (res.statusCode == 200 && res.data.code == 1) {
					res.data.data.forEach(item => {
						this.news.push({
							notice: item
						});
					});
				} else {
					this.Unfold_data.showWindow(res.data.msg);
				}
			});
		},
		//输入框赋值
		inputChange(e) {
			const key = e.currentTarget.dataset.key;
			this[key] = e.detail.value;
		},

		//底部导航
		changeTab(id) {
			this.curTab = id;
			if (id == 2) {
				go('/pages/center/center');
				
				// sui.navigateTo({
				//   url: "",
				// });
			} else if (id == 3) {
				go('/pages/saasShop/equity');
			} else if (id == 4) {
				go('/pages/center/cart');
				// sui.navigateTo({
				//   url: "",
				// });
				// } else if (id == 5) {
				// 	  // console.log(sui)
				//    //     sui.navigateTo({
				//    //       url: "/pages/center/user_chat/user_chat",
				//    //     });
				// go("/pages/center/user_chat/user_chat")
			} else if (id == 5) {
				//   sui.navigateTo({
				//   url: "/pages/center/user",
				// });

				go('/pages/center/user');
			}
		},

		//跳转立即收款
		not_pay() {
			//判断是否实名
			var userInfo = uni.getStorageSync('userInfo');
			if (userInfo.is_certification == 0) {
				uni.navigateTo({
					url: '/pages/trueName/trueName'
				});
			}

			let userStatus = uni.getStorageSync('userStatus');
			if (userStatus == '普通用户') {
				this.$refs.check.show();
				return;
			}

			//如果为空提示请输入收款金额
			if (!this.pay_s) {
				this.Unfold_data.showWindow('请输入收款金额');
				return;
			}
			//收款金额必须是整数型
			if (this.pay_s % 1 != 0) {
				this.Unfold_data.showWindow('收款金额必须是整数，不能包含小数点');
				return;
			}
			if (this.pay_s < 100) {
				this.Unfold_data.showWindow('收款金额必须大于等于100元');
				return;
			}
			this.defaultCard();
			//直接跳转
			uni.navigateTo({
				url: '/pages/Payment_without_card/Payment_without_card?price=' + this.pay_s + '&token=' + this.token
			});

			//判断用户是否开通无卡支付,如果未开通跳开通页面，否则跳无卡页面
			// var url = '/api/quickpay/register/isOpen'
			// let params={token:this.token}
			// uni.showLoading({
			// 	title:'正在检测您是否开通无卡支付',
			// 	mask:true,

			// })
			// setTimeout(()=>{
			// 	this.Unfold_data.upload_data(params,'GET',url,res=>{
			// 		if(res.statusCode!=200&&res.data.code!=200){
			// 			this.Unfold_data.showWindow(res.data.msg)
			// 		}
			// 		uni.hideLoading()
			// 		this.isOpen = res.data.data.isOpen
			// 		// return

			// 		this.$nextTick(function() {
			// 			this.AlertClass = 0;
			// 			this.AlertPosition = 'center';
			// 			this.$nextTick(function() {
			// 				// console.log(this.$refs)
			// 				this.$refs.openAlert2.Show();
			// 			});
			// 		});

			// 	})
			// },900)
		},
		//获取默认卡片
		defaultCard() {
			let params = {
				token: this.token
			};
			var url = '/api/bankcard/bankcard/default';
			this.Unfold_data.upload_data(params, 'POST', url, res => {
				if (res.statusCode == 200 && res.data.code == 1) {
					this.cards = res.data.data;
					// console.log(this.price_s)
					//判断是否有默认收款卡
				} else {
					//显示错误信息
					this.Unfold_data.showWindow(res.data.msg);
				}
			});
		},
		//跳转
		navTo(item) {
			let userStatus = uni.getStorageSync('userStatus');
			if (userStatus == '普通用户') {
				this.$refs.check.show();
				return;
			}
			var urlStr = item.url; //encodeURI(url)//把字符串作为url进行编码
			console.log(urlStr);
			if (item.title == '快捷支付') {
				if (plus.os.name == 'Android') {
					//安卓
					if (
						plus.runtime.isApplicationExist({
							//查看安卓系统手机有没有下载这款app
							pname: 'com.txgapp.dsmobleps' //app云打包的包名
						})
					) {
						//安装了app
						plus.runtime.openURL('doushuarapp://doushuar', function(res) {
							console.log(res);
						});
					} else {
						//未安装app
						uni.showModal({
							title: '提示',
							content: '您还没有此APP,去注册下载',
							success: function(res) {
								if (res.confirm) {
									plus.runtime.openURL('http://newpay-api.txguu.cn/share/dsShare?invite=e09669938', function(res) {
										console.log(res);
									});
								} else if (res.cancel) {
									console.log('用户点击取消');
								}
							}
						});
					}
				} else if (plus.os.name == 'iOS') {
					//苹果
					//因为ios查不到B款app在ios系统手机里面，其实下载了，也是检测不到，所以就不检测了
					//直接打开微信app，微信pp没有的话，会进入回调报错，我们在回调去打开下载链接
					plus.runtime.launchApplication(
						{
							action: 'doushuar://'
						},
						function(e) {
							uni.showModal({
								title: '提示',
								content: '您还没有此APP,去注册下载',
								success: function(res) {
									if (res.confirm) {
										plus.runtime.openURL('http://newpay-api.txguu.cn/share/dsShare?invite=e09669938', function(res) {
											console.log(res);
										});
									} else if (res.cancel) {
										console.log('用户点击取消');
									}
								}
							});
						}
					);
				}
			} else if (item.title == '网赚') {
				let urls = urlStr + '?shop_id=' + this.shop_id + '&token=' + this.token;
				uni.navigateTo({
					url: urls
				});
			} else {
				this.Unfold_data.showWindow('【敬请期待】');
			}
		},

		//特色服务外连接跳转
		navToSeaver(item) {
			console.log(666,item)
			let urls = item.url + '?token=' + this.token;
			uni.navigateTo({
				url: urls
			});
		},

		more_serve() {
			this.Unfold_data.showWindow('敬请期待');
		},

		//首页轮播外链接跳转
		link_url(url) {
			// this.Unfold_data.externalLinks(url)
			var urlStr = url; //encodeURI(url)//把字符串作为url进行编码
			console.log(urlStr);
			if (urlStr.indexOf('/pages') == -1) {
				uni.setStorageSync('browse_url', urlStr);
				uni.navigateTo({
					url: '/pages/web/browse?url=1' + '&token=' + this.token
				});
			} else {
				let urls = urlStr + '?token=' + this.token;
				uni.navigateTo({
					url: urls
				});
			}
		},
		//跳转资讯列表
		go_zixunList() {
			uni.navigateTo({
				url: '/pages/zixunlist/zixunlist?token=' + this.token
			});
		},
		//跳转商品详情
		go_goodsDetail(item) {
			uni.navigateTo({
				url: '/pages/goodsDetail/goodsDetail?id=' + item.id + '&token=' + this.token
			});
		},
		//底部导航
		select_click(callback) {
			callback(this.tab_index_click);
		},
		//跳转产品列表
		mallList() {
			uni.navigateTo({
				url: '../indexMallList/indexMallList?token=' + this.token
			});
		}, // 获取当前版本号
		// 跳转资讯详情
		toZixunDetail(item) {
			uni.navigateTo({
				url: '/pages/zixunDetail/zixunDetail?id=' + item.id + '&token=' + this.token
			});
		}
		// plusReady() {
		// 	var that = this; // 获取本地应用资源版本号
		// 	plus.runtime.getProperty(plus.runtime.appid, function(inf) {
		// 		that.wgtVer = inf.version; //获取当前版本号
		// 		that.version = plus.runtime.version;
		// 	});
		// }, // 检查是否安卓
		// isandroid() {
		// 	var that = this;
		// 	uni.getSystemInfo({
		// 		success: res => {
		// 			if (res.platform == 'android') {
		// 				that.AndroidCheckUpdate();
		// 			}
		// 		}
		// 	});
		// }, // 自动更新
		// AndroidCheckUpdate() {
		// 	var that = this;
		// 	uni.request({
		// 		url: this.Config_ysy.dnsurl + '/api/index/version', //获取最新版本号
		// 		method: 'GET',
		// 		header: {
		// 			'content-type': 'application/x-www-form-urlencoded'
		// 		},
		// 		data: {
		// 			version: this.Config_ysy.version
		// 		},
		// 		success: res => {
		// 			if (res.data.data.newversion != this.Config_ysy.version) {
		// 				if (plus.networkinfo.getCurrentType() != 3) {
		// 					uni.showToast({
		// 						title: '有新的版本发布，检测到您目前非Wifi连接，为节约您的流量，程序已停止自动更新，将在您连接WIFI之后重新检测更新。',
		// 						mask: false,
		// 						duration: 5000,
		// 						icon: 'none'
		// 					});
		// 					return;
		// 				}
		// 				uni.showToast({
		// 					title: '有新的版本发布，检测到您目前为Wifi连接，程序已启动自动更新。新版本下载完成后将自动弹出安装程序。',
		// 					mask: false,
		// 					duration: 5000,
		// 					icon: 'none'
		// 				}); //res.data.androidurl    是apk的下载链接
		// 				var dtask = plus.downloader.createDownload(res.data.data.downloadurl, {}, function(d, status) {
		// 					// 下载完成
		// 					if (status == 200) {
		// 						plus.runtime.install(plus.io.convertLocalFileSystemURL(d.filename), {}, {}, function(error) {
		// 							uni.showToast({
		// 								title: '安装失败',
		// 								mask: false,
		// 								duration: 1500
		// 							});
		// 						});
		// 					} else {
		// 						uni.showToast({
		// 							title: '更新失败',
		// 							mask: false,
		// 							duration: 1500
		// 						});
		// 					}
		// 				});
		// 				dtask.start();
		// 			}
		// 		}
		// 	});
		// }
	}
};

function go(_url) {
	console.log('sui', sui);
	sui.navigateTo({
		url: _url
	});
}
</script>

<style lang="scss">
.content {
	width: 750rpx;
	padding-bottom: 120rpx;
	position: relative;
	.bg {
		width: 750rpx;
		height: 100%;
		min-height: 100%;
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: -10;
	}
	.top_bar {
		width: 100%;
		padding: 0 30upx;
		padding-top: 90upx;
		height: 150rpx;
		background-color: #2b2b2b;
		display: flex;
		align-items: center;
		justify-content: center;
		position: fixed;
		top: 0;
		left: 0;
		z-index: 100;
		.location {
			flex: 3;
			display: -webkit-box;
			-webkit-box-orient: vertical;
			-webkit-line-clamp: 1;
			overflow: hidden;
			color: #ffffff;
		}
		.img {
			flex: 1;
			display: flex;
			align-items: center;
			justify-content: center;
			image {
				width: 40rpx;
				height: 40rpx;
			}
		}
		.tongzhi {
			flex: 8;
			width: 100%;
			.swiper {
				width: 90%;
				margin: 0 auto;
				height: 50rpx;
				border-radius: 10rpx;
				background: #c3ad84;
				.swiper-item {
					font-size: 28rpx;
					width: 90%;
					height: 50rpx;
					display: flex;
					align-items: center;
					margin: 0 auto;
				}
			}
		}
		.saoma {
			flex: 1;
			display: flex;
			align-items: center;
			justify-content: center;
			image {
				width: 50rpx;
				height: 50rpx;
			}
		}
	}
	.openAlert {
		width: 100%;
		.modal_wrap {
			width: 75vw;
			height: 100%;
			background-color: #ffffff;
			border-radius: 20upx;
			.modal_title {
				width: 100%;
				height: 80upx;
				// background: #f0deb5;
				background: linear-gradient(#f0deb5, #a88950); /* 标准语法 */
				border-radius: 20upx 20upx 0 0;
				color: #000000;
				display: flex;
				align-items: center;
				justify-content: center;
			}

			.modal_content {
				width: 70%;
				margin: 0 auto;
				display: flex;
				align-items: center;
				justify-content: center;
				padding: 40upx 0;
				.con_item {
					text-align: center;
					font-size: 30upx;
				}
			}

			.btn_wrap {
				width: 100%;
				display: flex;
				align-items: center;
				justify-content: center;
				.cancel_btn {
					width: 200upx;
					margin: 30upx auto;
					height: 60upx;
					margin-top: 20upx;
					border: 2upx solid #f0deb5;
					color: #000000;
					display: flex;
					align-items: center;
					justify-content: center;
				}
				.modal_btns {
					width: 200upx;
					margin: 30upx auto;
					height: 60upx;
					margin-top: 20upx;
					background: linear-gradient(top, #f0deb5, #a88950);
					color: #000000;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}
	.init_money {
		width: 100%;
		padding-top: 170upx;
		.bg_tu {
			width: 95%;
			margin: 0 auto;
			position: relative;
			image {
				width: 100%;
				height: 360upx;
				position: absolute;
				top: 0;
				left: 0;
				z-index: -5;
				border-radius: 20rpx;
				box-shadow: 0rpx 20rpx 30rpx #5d5849;
			}
		}
		.content {
			color: #ffffff;
			width: 85%;
			margin: 0 auto;
			padding: 20rpx 0;
			.title {
				width: 100%;
				font-size: 30rpx;
				text-align: left;
			}
			.wrap {
				width: 80%;
				margin: 0 auto;
				padding-top: 70rpx;
				.wrap_top {
					width: 100%;
					display: flex;
					align-items: center;
					justify-content: center;
					.fuhao {
						flex: 1;
						.qian_img {
							width: 60upx;
							height: 60upx;
						}
					}
					.input {
						flex: 7;
						width: 100%;
						height: 80rpx;
						padding: 5rpx 0;
						border-bottom: 2rpx solid #ffffff;
						display: flex;
						align-items: flex-end;
						justify-content: flex-end;
						input {
							font-size: 30rpx;
							width: 70%;
							padding-right: 10rpx;
						}
					}
					.yuan {
						flex: 2;
						font-size: 50rpx;
						display: flex;
						align-items: center;
						justify-content: center;
					}
				}
				.shoukuan_btn {
					width: 90%;
					margin: 0 auto;
					margin-top: 20rpx;
					height: 60rpx;
					border-radius: 10rpx;
					color: #fff;
					font-weight: bold;
					background: #f2af28;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}
	}
	.xuanxiangka {
		width: 90%;
		margin: 0 auto;
		height: 400rpx;
		margin-top: 40rpx;
		background-color: rgba(0, 0, 0, 0.3);
		display: flex;
		align-items: center;
		justify-content: center;
		border-radius: 30rpx;
		.card {
			width: 100%;
			display: flex;
			align-items: center;
			flex-wrap: wrap;
			justify-content: center;
			.card_item {
				width: 24%;
				margin-top: 20rpx;
				margin-right: 1%;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				.img {
					flex: 1;
					image {
						width: 100upx;
						height: 100upx;
					}
				}
				.title {
					color: #ffffff;
					font-size: 26rpx;
				}
			}
			.card_item:nth-child(4n) {
				margin-right: none;
			}
		}
	}
	.banner {
		width: 90%;
		margin: 0 auto;
		margin-top: 40rpx;
		border: 2rpx solid #ffffff;
		border-radius: 30rpx;
		overflow: hidden;
		box-shadow: 0rpx 10rpx 50rpx #706e6e;
		swiper {
			width: 100%;
			height: 230rpx;
			swiper-item {
				border-radius: 30rpx;
				overflow: hidden;
				image {
					width: 100%;
					height: 100%;
				}
			}
		}
	}
	.mingxing_product {
		width: 90%;
		margin: 0 auto;
		margin-top: 40rpx;
		.product_title {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			.title_left {
				flex: 1;
				.img {
					width: 50%;
					position: relative;
					image {
						width: 100%;
						height: 52upx;
						box-shadow: 5rpx 10rpx 20rpx #636363;
						position: absolute;
						left: 0;
						top: 0;
						z-index: -4;
					}
				}
				.name {
					width: 50%;
					color: var(--themeColor);
					text-align: center;
					font-weight: bold;
					height: 45rpx;
					line-height: 45rpx;
					vertical-align: middle;
				}
			}
			.title_right {
				flex: 1;
				color: #ffffff;
				font-weight: bold;
				display: flex;
				align-items: center;
				justify-content: flex-end;
				text {
					padding-right: 10upx;
				}
				image {
					width: 15upx;
					height: 28upx;
				}
			}
		}
		.product_content {
			width: 100%;
			margin-top: 30rpx;
			height: 240rpx;
			background: rgba(0, 0, 0, 0.4);
			border-radius: 20rpx;
			.content_wrap {
				width: 100%;
				padding: 10rpx 0;
				display: flex;
				align-items: center;
				justify-content: flex-start;
				.content_item {
					width: 31.33%;
					height: 220rpx;
					margin: 0 2%;
					align-items: center;
					justify-content: center;
					color: #ffffff;
					.img {
						width: 100%;
						height: 80%;
						position: relative;
						border-radius: 20rpx;
						overflow: hidden;
						image {
							width: 100%;
							height: 100%;
							border-radius: 20rpx;
							overflow: hidden;
						}
						.title {
							height: 30rpx;
							line-height: 30rpx;
							width: 100%;
							background: rgba(87, 87, 87, 0.5);
							font-size: 24rpx;
							position: absolute;
							bottom: 0;
							left: 10rpx;
						}
					}
					.name {
						margin-top: 10rpx;
						width: 100%;
						height: 50upx;
						display: flex;
						align-items: center;
						justify-content: center;
						.name_detail {
							color: #b9b0b0;
							font-size: 26rpx;
						}
						.biaoqian {
							color: #f5680a;
						}
					}
				}
			}
		}
	}
	.searve {
		width: 90%;
		margin: 0 auto;
		margin-top: 30rpx;
		.product_title {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: center;
			.title_left {
				flex: 1;
				.img {
					width: 50%;
					position: relative;
					image {
						width: 100%;
						height: 52upx;
						box-shadow: 5rpx 10rpx 20rpx #636363;
						position: absolute;
						left: 0;
						top: 0;
						z-index: -4;
					}
				}
				.name {
					width: 50%;
					color: var(--themeColor);
					text-align: center;
					font-weight: bold;
					height: 45rpx;
					line-height: 45rpx;
					vertical-align: middle;
				}
			}
			.title_right {
				flex: 1;
				color: #ffffff;
				font-weight: bold;
				display: flex;
				align-items: center;
				justify-content: flex-end;
				text {
					padding-right: 10upx;
				}
				image {
					width: 15upx;
					height: 28upx;
				}
			}
		}
		.searve_xiang {
			width: 100%;
			margin-top: 20rpx;
			height: 200rpx;
			background: rgba(0, 0, 0, 0.4);
			border-radius: 20rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			.searve_item {
				flex: 1;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: center;
				.img {
					image {
						width: 100rpx;
						height: 100rpx;
					}
				}
				.title {
					color: #ffffff;
				}
			}
		}
	}
	.industry_information {
		width: 90%;
		margin: 0 auto;
		margin-top: 30rpx;
		display: flex;
		justify-content: space-between;
		.title {
			width: 25%;
			.img {
				width: 100%;
				position: relative;
				image {
					width: 100%;
					height: 52upx;
					box-shadow: 5rpx 10rpx 20rpx #636363;
					position: absolute;
					left: 0;
					top: 0;
					z-index: -4;
				}
			}
			.name {
				width: 100%;
				color: var(--themeColor);
				text-align: center;
				font-weight: bold;
				height: 45rpx;
				line-height: 45rpx;
				vertical-align: middle;
			}
		}
		.title_right {
			flex: 1;
			color: #ffffff;
			font-weight: bold;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			text {
				padding-right: 10upx;
			}
			image {
				width: 15upx;
				height: 28upx;
			}
		}
	}
	// .information_content {
	// 	width: 90%;
	// 	margin: 0 auto;
	// 	margin-top: 20rpx;
	// 	background: #ffffff;
	// 	border-radius: 30rpx;
	// 	.content_item_zixun {
	// 		border-bottom: 2upx solid #cacaca;
	// 		padding: 20upx 0upx;
	// 		display: flex;
	// 		width: 100%;
	// 		height: 200upx;
	// 		.content_left_zixun {
	// 			flex: 5;
	// 			text-wrap: wrap;
	// 			overflow: hidden;
	// 			display: flex;
	// 			flex-direction: column;
	// 			justify-content: space-around;
	// 			margin-left: 20upx;
	// 			.content_title {
	// 				width: 90%;
	// 				display: -webkit-box;
	// 				-webkit-box-orient: vertical;
	// 				-webkit-line-clamp: 1;
	// 				overflow: hidden;
	// 			}
	// 			.content_box {
	// 				width: 95%;
	// 				height: 80upx;
	// 				color: #8b8b8b;
	// 				display: -webkit-box;
	// 				-webkit-box-orient: vertical;
	// 				-webkit-line-clamp: 2;
	// 				overflow: hidden;
	// 			}
	// 			.content_bottom {
	// 				display: flex;
	// 				justify-content: space-between;
	// 				color: #cccccc;
	// 			}
	// 		}
	// 		.content_right_zixun {
	// 			flex: 2;
	// 			display: flex;
	// 			flex-direction: row;
	// 			justify-content: center;
	// 			align-items: center;
	// 			image {
	// 				border-radius: 20upx;
	// 				overflow: hidden;
	// 				width: 90%;
	// 				height: 90%;
	// 			}
	// 		}
	// 	}
	// 	.content_item_zixun:last-child{
	// 		border-bottom: none;
	// 	}
	// }
	.information_content {
		width: 90%;
		margin: 0 auto;
		.content_item_zixun {
			width: 100%;
			padding: 20upx;
			background: rgba($color: #000000, $alpha: 0.5);
			margin-top: 20upx;
			border-radius: 30upx;
			display: flex;
			align-items: center;
			.content_left_zixun {
				flex: 5;
				display: flex;
				flex-direction: column;
				justify-content: space-around;
				.content_title {
					width: 90%;
					color: #af8e63;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 1;
					overflow: hidden;
				}
				.content_box {
					width: 100%;
					height: 70upx;
					font-size: 26upx;
					color: #ffffff;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
					overflow: hidden;
					.rich-text {
						font-size: 26upx;
						color: #ffffff;
					}
				}
				.content_bottom {
					display: flex;
					justify-content: flex-end;
					color: #d5c9bb;
					font-size: 20upx;
					.bottom_right {
						padding-right: 30upx;
					}
				}
			}
			.content_right_zixun {
				flex: 2;
				display: flex;
				flex-direction: row;
				justify-content: center;
				align-items: center;
				image {
					border-radius: 20upx;
					overflow: hidden;
					width: 180upx;
					height: 140upx;
				}
			}
		}
	}

	.bottom-tab {
		position: fixed;
		z-index: 3000;
		// background-image: url(https://jialianxin-1301053941.cos.ap-chengdu.myqcloud.com/static/tab.png);
		background-color: #f7f6f6;
		bottom: 0%;
		left: 0%;
		width: 100%;
		height: 120upx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.bottom-tab-item-center {
			width: 24%;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			margin-top: -40upx;
			.first-img {
				width: 100upx;
				height: 100upx;
				margin-top: -0.8rem;

				border-radius: 50%;
			}
			.text-position {
				margin-top: 0rem;
				font-size: 0.6rem;
				color: #757575;
			}
			.text-on {
				color: #b49828;
			}
		}
		.bottom-tab-item-sider {
			width: 15%;
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			.first-img {
				width: 46upx;
				height: 46upx;
			}
			.text-position {
				margin-top: 12upx;
				font-size: 0.6rem;
				color: #757575;
			}
			.text-on {
				font-weight: bold;
				color: #f7992b;
			}
		}
	}
}
</style>
